{include file="public/header" /}
<body>
<div class="x-body">
    {volist name="$maintenanceInfo" id="maintenanceInfoList"}
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">设备编号</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="equi_id" value="{$maintenanceInfoList.equi_id}" title="禁止修改" disabled>
                <input type="hidden" name="id" value="{$maintenanceInfoList.id}" title="禁止修改" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">日期</label>
            <div class="layui-input-inline">
                <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"  value="{$maintenanceInfoList.date}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">行为</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="action" value="{$maintenanceInfoList.action}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">理由</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="reason" value="{$maintenanceInfoList.reason}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">方法</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="function" value="{$maintenanceInfoList.function}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">效果跟踪</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="track" value="{$maintenanceInfoList.track}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">维修人</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="maintenance_staff" value="{$maintenanceInfoList.maintenance_staff}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">审核人</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="auditor" value="{$maintenanceInfoList.auditor}">
            </div>
        </div>
        {/volist}
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button class="layui-btn" lay-submit lay-filter="addId" >
                确认修改
            </button>
        </div>
    </form>
</div>
</body>
<script>
    //日期
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#date' //指定元素
        });
    });
    layui.use(['form'], function(){
        $ = layui.jquery;
        var form = layui.form,layer = layui.layer;
        //监听提交
        form.on('submit(addId)', function(data){
            //console.log(data);
            $.post("{:url('index/EquipmentMaintain/update')}",data.field,function(info){
                if (info) {
                    layer.alert("更新成功", {icon: 6},function () {
                        window.parent.location.reload();  //刷新父级页面
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前弹出层
                        parent.layer.close(index);
                    });
                }else{
                    layer.alert("更新失败", {icon: 5});
                }
            },'json');
            return false;
        });
    });
</script>

</html>